﻿using BasicInformation.ApiRead.Application.Command.Storage;
using BasicInformation.Domain;
using BasicInformation.Dtos;
using BasicInformation.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BasicInformation.ApiRead.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class StorageController : ControllerBase
    {
        private readonly IMediator mediator;

        public StorageController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public async Task<ApiPaging<StorageDTO>> GetStorage([FromQuery]GetStorageCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
